package com.neu.dao.klz;

import com.neu.dao.BaseDao;
import com.neu.util.DBUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.MapListHandler;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public class AddDaoImpl extends BaseDao {
    public List<Map<String,Object>> findById(int id){
        List<Map<String, Object>> list=null;
        String sql="select * from t_address where u_id=?";
        QueryRunner qr=new QueryRunner(DBUtils.getDataSource());
        try {
            list=qr.query(sql,new MapListHandler(),id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return list;
    }
}